<div class="box box-info">
  <div class="box-header with-border">
    <h3 class="box-title">添加角色信息</h3>
    <div class="box-tools">
      <span onclick="HtmlRender('${BASE}/admin/sys/SysRole/index')" class="btn btn-info btn-sm">列表</span>
    </div>
  </div>
 
  <form action="${BASE}/admin/sys/SysRole/save" id="form_save" method="post" class="form-horizontal">
  <div class="box-body">
  
      <div class="form-group">
        <label for="officeId" class="col-sm-3 control-label">归属机构：</label>
        <div class="col-sm-6">
          <input type="text" id="officeId" name="officeId" value="" class="form-control">
        </div>
        <div class="col-sm-3"> </div>
      </div>
      
      <input type="hidden" id="parentId" name="parentId" value="${parentDept.id}" />
      <div class="form-group">
        <label for="parentId" class="col-sm-3 control-label">归属机构：</label>
        <div class="col-sm-6">
        <div class="input-group">
          <input type="text" id="parentName" name="parentName" value="${parentDept.name}" class="form-control" readonly="readonly" >
          <span class="input-group-btn" id="btn_span_parentIds"><button type="button" class="btn btn-info btn-flat"><i class="fa fa-th"></i> 选择上级机构</button></span>
        </div>
        </div>
        <div class="col-sm-3"> </div>
      </div>
      
      <div class="form-group">
        <label for="name" class="col-sm-3 control-label">角色名称：</label>
        <div class="col-sm-6">
          <input type="text" id="name" name="name" value="" class="form-control">
        </div>
        <div class="col-sm-3"> </div>
      </div>
      <div class="form-group">
        <label for="enname" class="col-sm-3 control-label">英文名称：</label>
        <div class="col-sm-6">
          <input type="text" id="enname" name="enname" value="" class="form-control">
        </div>
        <div class="col-sm-3"> </div>
      </div>
      <div class="form-group">
        <label for="roleType" class="col-sm-3 control-label">角色类型：</label>
        <div class="col-sm-6">
          <input type="text" id="roleType" name="roleType" value="" class="form-control">
        </div>
        <div class="col-sm-3"> </div>
      </div>
      <div class="form-group">
        <label for="dataScope" class="col-sm-3 control-label">数据范围：</label>
        <div class="col-sm-6">
          <input type="text" id="dataScope" name="dataScope" value="" class="form-control">
        </div>
        <div class="col-sm-3"> </div>
      </div>
      <div class="form-group">
        <label for="isSys" class="col-sm-3 control-label">是否系统数据：</label>
        <div class="col-sm-6">
          <input type="text" id="isSys" name="isSys" value="" class="form-control">
        </div>
        <div class="col-sm-3"> </div>
      </div>
      <div class="form-group">
        <label for="summary" class="col-sm-3 control-label">角色描述：</label>
        <div class="col-sm-6">
          <input type="text" id="summary" name="summary" value="" class="form-control">
        </div>
        <div class="col-sm-3"> </div>
      </div>

      <div class="form-group">
        <label class="col-sm-3 control-label">备注信息：</label>
        <div class="col-sm-6">
          <textarea id="remarks" name="remarks" cols="" rows="" class="form-control"  placeholder="备注信息...255个字符以内" dragonfly="true" onKeyUp="textarealength(this,255)"></textarea>
          <p class="textarea-numberbar"><em class="textarea-length">0</em>/255</p>
        </div>
        <div class="col-sm-3"> </div>
      </div>
      
  </div>
  <div class="box-footer">
    <div class="col-sm-10 col-sm-offset-2">
      <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;保存&nbsp;&nbsp;">
    </div>
  </div>
  </form>

</div>
  
<script type="text/javascript">
$(function(){
	$("#form_save").validate({
		errorPlacement: function(error, element) {
			error.appendTo(element.parent());
		},
		submitHandler : function(form) {
			layer.load(1, {shade: [0.3,'#fff']});
			$(form).ajaxSubmit({
				dataType:"json",
				success:function( jsondata ){
					layer.closeAll('loading');
					if( jsondata.code == "001" ){
						layer.msg(jsondata.msg, {icon: 6,offset: '45px'});
						HtmlRender("${BASE}/admin/sys/SysRole/index");
					}else{
						layer.msg(jsondata.msg, {icon: 5,offset: '45px'});
					}
				}
			});
		},
		rules : {
			name : {
				required : true
			}
		}, 
		messages : { 
			name : { 
				required : "名称不能为空"
			}
		}
	});
});
</script>